/**
 * @方法说明：判断函数类型
 * @方法名：getType
 * @参数：data
*/

//方法
function getType(data) {
    return Object.prototype.toString.call(data).slice(8, -1);
}

console.log(getType({}));//Object
console.log(getType([]));//Array
console.log(getType('hello'));//String
console.log(getType(12));//Number
console.log(getType(function test(){}));//Function
console.log(getType(null));//Null
console.log(getType(undefined));//Undefined
console.log(getType(true));//Boolean